package com.dameng.work.service.impl;

import com.dameng.work.dao.AccountDao;
import com.dameng.work.pojo.Account;

import com.dameng.work.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;


/**
 * CREATE TABLE "SYSDBA"."ACCOUNT"
 * (
 * "ID" INT IDENTITY(1, 1) NOT NULL,
 * "CREATEDATE" TIMESTAMP(0) NOT NULL,
 * "USERNAME" VARCHAR2(50),
 * "PASSWORD" VARCHAR2(50)) STORAGE(ON "MAIN", CLUSTERBTR) ;
 */
@Service
public class AccountServiceImpl implements AccountService {


    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private AccountDao accountDao;
    @Override
    public List<Account> findAll() {

        List<Account> allAccount = accountDao.findAllAccount();


        return allAccount;
    }

    @Override
    public List<Account> findAllByDate() {
        HashMap<String, Object> stringDateHashMap = new HashMap<>();
        stringDateHashMap.put("begintime",new Date());
        List<Account> allAccount = accountDao.findAccountByCreateDate(stringDateHashMap);


        return allAccount;
    }


}
